package com.shujia.wyh.day06.ketang;

/*
    Person
    eat()
    SouthPerson
    eat()
    NorthPerson
    eat()

 */

class Person3{
    public void eat(){
        System.out.println("吃");
    }
}

class SouthPerson extends Person3{
    @Override
    public void eat() {
        System.out.println("南方人吃大米");
    }

    public void maJiang(){
        System.out.println("打麻将");
    }
}

class NorthPerson extends Person3{
    @Override
    public void eat() {
        System.out.println("北方人吃面食");
    }

    public void xizao(){
        System.out.println("北方人喜欢搓澡");
    }
}

public class DuoTaiTest1 {
    public static void main(String[] args) {
        //创建一个南方人对象
        Person3 southPerson = new SouthPerson();
        southPerson.eat();
//        southPerson.maJiang();
        //向下转型
        SouthPerson southPerson1 = (SouthPerson) southPerson;
        southPerson1.eat();
        southPerson1.maJiang();
    }
}
